<!--main content start-->
<script src="js/workflow/CCBX/addCCbxLc-BSB1.js"></script>
<section id="main-content">
    <section class="wrapper">
        <!--state overview end-->
        <div class="row">
            <div class="col-lg-12">
                <section class="panel">
                    <header class="panel-heading">
                        现金报销申请 （报销申请提交后，即发送给相关联项目负责人进行审批，根据具体报销金额大小区分是否需要高层领导审批）
                        <!--<i class="add-icon icon-plus" ng-click="disDraft()"> 草稿</i>-->
                    </header>
                    <div class="panel-body">
                        <div class="form-group customerForm">
                            <label class="col-sm-2 control-label">现金报销总金额</label>
                            <div class="col-sm-10">
                                <input type="text" onkeyup="clearNoNum(this)" onblur="clearNoNum(this)" certus-required
                                    class="form-control" ng-model="trEntity.totalAmount" ng-disabled="true">
                            </div>
                        </div>
                        <div class="form-group customerForm">
                            <label class="col-sm-2 control-label">冲销数目</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" certus-an-limit-length-num="15"
                                    placeholder="请输入整数" ng-model="trEntity.chargeAgainest">
                            </div>
                        </div>
                        <div class="form-group customerForm">
                            <label class="col-sm-2 control-label">借款编码</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" list="browsersReim"
                                    placeholder="自动检索，查询结果较多时候，系统不显示，需要尽量多输入相关字段" ng-model="trEntity.borrowCode">
                                <datalist id="browsersReim" ng-model="selected">
                                    <option ng-repeat="x in triburseSelect" value="{{x.borrowerCode}}">
                                </datalist>
                            </div>
                        </div>
                    </div>
                </section>
                <section class="panel afrinfo" style="display: none;">
                    <header class="panel-heading">
                        报销分摊明细
                    </header>
                    <div class="panel-body">
                        <!--<div class="form-group customerForm">
                            <label class="col-sm-2 control-label">报销主体公司</label>
                            <div class="col-sm-10">
                                <select class="form-control" ng-model="trItem.trCompanyCode">
                                    <option ng-repeat="x in ccCompanySelect" certus-required-polyfill value="{{x.code}}">{{x.name}}</option>
                                </select>
                            </div>
                        </div>-->
                        <div class="form-group customerForm">
                            <label class="col-sm-2 control-label">报销类目</label>
                            <div class="col-sm-10">
                                <select class="form-control" ng-model="trItem.triClassCode">
                                    <option ng-repeat="x in ccClassSelect" certus-required-polyfill value="{{x.code}}">
                                        {{x.name}}</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group customerForm">
                            <label class="col-sm-2 control-label">开始日期</label>
                            <div class="col-sm-10">
                                <input id="dateTime1" class="form-control" certus-required-polyfill
                                    ng-model="trItem.startDate" onchange="dateChange1()">
                            </div>
                        </div>
                        <div class="form-group customerForm">
                            <label class="col-sm-2 control-label">结束日期</label>
                            <div class="col-sm-10">
                                <input id="dateTime2" class="form-control" certus-required-polyfill
                                    ng-model="trItem.endDate" onchange="dateChange1()">
                            </div>
                        </div>
                        <div class="form-group customerForm">
                            <label class="col-sm-2 control-label">金额</label>
                            <div class="col-sm-10">
                                <input type="text" certus-an-limit-length-num="50" class="form-control"
                                    certus-required-polyfill ng-model="trItem.money">
                            </div>
                        </div>
                        <div class="form-group customerForm">
                            <label class="col-sm-2 control-label">开始地点</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" certus-required-polyfill
                                    ng-model="trItem.startAddr">
                            </div>
                        </div>
                        <div class="form-group customerForm">
                            <label class="col-sm-2 control-label">结束地点</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" certus-required-polyfill
                                    ng-model="trItem.endAddr">
                            </div>
                        </div>
                        <div class="form-group customerForm">
                            <label class="col-sm-2 control-label">说明</label>
                            <div class="col-sm-10">
                                <textarea class="form-control"  maxlength="120"  certus-required-polyfill
                                    ng-model="trItem.trInstruction"></textarea>
                            </div>
                        </div>
                        <div class="form-group customerForm">
                            <label class="col-sm-2 control-label">原始单据数量</label>
                            <div class="col-sm-10">
                                <input type="text" certus-an-limit-length-int="10" class="form-control"
                                    certus-required-polyfill ng-model="trItem.triNum">
                            </div>
                        </div>
                        <p class="default-buttons">
                            <a href="javascript:void(0);" class="button-back btn btn-info"
                                ng-click="closeAddItem();">取消</a>
                            <a href="javascript:void(0);" class="button-next  btn btn-info"
                                ng-click="itemSubmit()">提交</a>
                        </p>
                    </div>
                </section>
                <section class="panel haddpro" style="display: none;">
                    <header class="panel-heading">
                        项目分配信息(剩余￥{{surplus}})
                    </header>
                    <div class="panel-body">
                        <div class="form-group customerForm">
                            <label class="col-sm-2 control-label">项目名称</label>
                            <div class="col-sm-10">
                                <input type="text" list="browsers2" ng-model="triPercent.projName" certus-required
                                    class="form-control" placeholder="自动检索，查询结果较多时候，系统不显示，需要尽量多输入相关字段">
                                <datalist id="browsers2" ng-model="selected">
                                    <option ng-repeat="x in userProjSelect2" value="{{x.projName}}">
                                </datalist>
                            </div>
                        </div>
                        <div class="form-group customerForm">
                            <label class="col-sm-2 control-label">金额</label>
                            <div class="col-sm-10">
                                <input type="text" certus-an-limit-length-num="50" class="form-control"
                                    ng-model="triPercent.money" ng-change="triPercentChange(triPercent.money)"
                                    placeholder="请分配发票金额以内">
                            </div>
                        </div>
                        <p class="default-buttons">
                            <a href="javascript:void(0);" class="button-back btn btn-info" onclick="haddpro();">取消</a>
                            <a href="javascript:void(0);" class="button-next  btn btn-info"
                                ng-click="percentSubmit(triPercent.projId)">提交</a>
                        </p>
                    </div>
                </section>
                <section class="panel">
                    <header class="panel-heading add-heading">
                        报销费用明细
                        <i class="add-icon icon-plus" ng-click="addItem()"> 新增</i>
                    </header>
                    <div class="panel-body">
                        <div id="afrContainer" class="dlshouwen-grid-container"></div>
                        <div id="afrToolBarContainer" class="dlshouwen-grid-toolbar-container"></div>
                    </div>
                </section>
                <section class="panel">
                    <div class="panel-body">
                        <p class="default-buttons">
                            <a href="javascript:void(0);" class="button-back btn btn-info"
                                onclick="window.history.back()">返回</a>
                            <a href="javascript:void(0);" class="button-next  btn btn-success btn-l10"
                                ng-click="startCCBXLc()">确认提交</a>
                            <a href="javascript:void(0);" class="button-next  btn btn-info "
                                ng-click="saveDraftCCBX()"><i class="icon-save"></i> 暂存</a>
                        </p>
                    </div>
                </section>
                <!-- Modal -->
                <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                    aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <section class="panel">
                                <div class="panel-heading add-heading">
                                    报销费用项目占比信息
                                    <i class="add-icon icon-remove" data-dismiss="modal" aria-hidden="true"></i>
                                </div>
                                <div class="panel-body selpro-box">
                                    <table class="table table-bordered">
                                        <tbody>
                                            <tr>
                                                <td>报销分公司</td>
                                                <td>
                                                    <span>{{trItem.trCompanyName}}</span>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>报销类目</td>
                                                <td>
                                                    <span>{{trItem.triClassName}}</span>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>发票金额</td>
                                                <td>
                                                    <span>￥{{trItem.money}}元</span>
                                                </td>
                                            </tr>
                                            <tr ng-repeat="bb in nowprojectPercents">
                                                <td>{{bb.projName}}</td>
                                                <td>
                                                    <div class="sh-btn">
                                                        <span>￥{{bb.money}}</span>
                                                        <button class="sedit-label btn btn-xs btn-danger"
                                                            ng-click="delPercent(bb.projId);">
                                                            <i class="fa fa-trash-o"></i> 删除</button>
                                                        <button class="sedit-label btn btn-xs btn-info"
                                                            ng-click="editPercent(bb.projId);">
                                                            <i class="fa fa-edit"></i> 修改</button>
                                                    </div>
                                                    <div class="hd-btn" style="display: none;">
                                                        <input type="text" onkeyup="clearNoNum(this)"
                                                            onblur="clearNoNum(this)" value="" class="form-control"
                                                            min="0" max="100">
                                                        <button class="sedit-label btn btn-xs btn-info"
                                                            onclick="closePro(1);">
                                                            <i class="icon-share-alt"></i> 取消</button>
                                                        <button class="sedit-label btn btn-xs btn-success"
                                                            onclick="closePro(1);">
                                                            <i class="icon-refresh"></i> 确认</button>
                                                    </div>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="panel-bg"></div>
                            </section>
                        </div>
                        <!-- /.modal-content -->
                    </div>
                    <!-- /.modal-dialog -->
                </div>
                <!-- Modal -->
                <div class="modal fade" id="yourModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                    aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <section class="panel">
                                <div class="panel-heading add-heading">
                                    报销费用项目占比信息
                                    <i class="add-icon icon-remove" data-dismiss="modal" aria-hidden="true"></i>
                                </div>
                                <div class="panel-body selpro-box">
                                    <table class="table table-bordered">
                                        <tbody>
                                            <tr ng-repeat="xx in dafts">
                                                <td>
                                                    <span><a ng-click="openDraf(xx.trCode)">{{xx.createTime |
                                                            date:'yyyy-MM-dd hh:mm'}}</a></span>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="panel-bg"></div>
                            </section>
                        </div>
                        <!-- /.modal-content -->
                    </div>
                    <!-- /.modal-dialog -->
                </div>
                <!-- /.modal -->
            </div>
        </div>
    </section>
</section>